<?php
	$idpersonal = $_GET['idpersonal'];
		
	include 'open-connection.php';

	// Performing SQL query
	$query = "DELETE FROM personal WHERE personal.idpersonal=$idpersonal";
	$result = mysql_query($query);// or die('Query failed: ' . mysql_error());
	
	$err = mysql_errno($link);
	
	include 'close-connection.php';
	
	if ($err > 0) {
		if ($err == 1451)
			echo json_encode(array(error => 'No se puede incluir registro'));
	} else {
		include 'select-personal.php';
	}
	
	
?>